package com.dailyblue.java.thread.作业;

import lombok.SneakyThrows;

// 开发一个线程类，该类的构造方法参数是线程名称，该线程的功能是从1打印到100。
public class DemoA extends Thread {
    public DemoA(String name) {
        this.setName(name);
    }

    @SneakyThrows
    public void run() {
        for (int i = 1; i < 101; i++) {
            System.out.println(Thread.currentThread().getName() + ":" + i);
            Thread.sleep(100);
            //Thread.yield();
        }
    }
}
